const mysql = require('mysql')
const db = mysql.createPool({
  host: '127.0.0.1',
  user: 'root',
  password: 'admin123',
  database: 'sc5342'
})

// 测试 mysql模块是否正常工作
db.query('select * from class5342', (err, results) => {
  if (err) return console.log(err.message)
  console.log('Database connection succeeded')
})

module.exports = db

